package lab02.test06;

public class Ladder {
    double upLength;
    double downLength;
    double height;
    double area;

    //无参构造
    public Ladder() {
    }

    //有参构造
    public Ladder(double upLength, double downLength, double height) {
        this.upLength = upLength;
        this.downLength = downLength;
        this.height = height;
    }

    public double area() {
        area = (upLength + downLength) * height / 2;
        return area;
    }

}
